load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "bootstrap",
    srcs = [
        "initial_values.go",
        "kv_writer.go",
        "metadata.go",
    ],
    embedsrcs = [
        "data/24_1_system.keys",
        "data/24_1_system.sha256",
        "data/24_1_tenant.keys",
        "data/24_1_tenant.sha256",
        "data/24_2_system.keys",
        "data/24_2_system.sha256",
        "data/24_2_tenant.keys",
        "data/24_2_tenant.sha256",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/bootstrap",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/config/zonepb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/multitenant/mtinfopb",
        "//pkg/roachpb",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/systemschema",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/rowenc",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/catid",
        "//pkg/sql/sem/tree",
        "//pkg/util/intsets",
        "//pkg/util/iterutil",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "bootstrap_test",
    srcs = [
        "bootstrap_test.go",
        "main_test.go",
        "splits_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":bootstrap"],
    deps = [
        "//pkg/base",
        "//pkg/clusterversion",
        "//pkg/config/zonepb",
        "//pkg/keys",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/testutils",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_stretchr_testify//require",
    ],
)
